package com.jindy.module.AssetCheck.service.impl;

import java.util.List;

import com.jindy.common.core.domain.entity.SysUser;
import com.jindy.common.utils.DateUtils;
import com.jindy.module.AssetDetails.domain.AssetDetails;
import com.jindy.module.AssetDetails.mapper.AssetDetailsMapper;
import com.jindy.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jindy.module.AssetCheck.mapper.AssetCheckMapper;
import com.jindy.module.AssetCheck.domain.AssetCheck;
import com.jindy.module.AssetCheck.service.IAssetCheckService;

/**
 * 资产盘点Service业务层处理
 *
 * @author jindy
 * @date 2023-04-27
 */
@Service
public class AssetCheckServiceImpl implements IAssetCheckService
{
    @Autowired
    private AssetCheckMapper assetCheckMapper;

    @Autowired
    private AssetDetailsMapper assetDetailsMapper;


    /**
     * 查询资产盘点
     *
     * @param id 资产盘点主键
     * @return 资产盘点
     */
    @Override
    public AssetCheck selectAssetCheckById(Long id)
    {
        return assetCheckMapper.selectAssetCheckById(id);
    }

    /**
     * 查询资产盘点列表
     *
     * @param assetCheck 资产盘点
     * @return 资产盘点
     */
    @Override
    public List<AssetCheck> selectAssetCheckList(AssetCheck assetCheck)
    {
        return assetCheckMapper.selectAssetCheckList(assetCheck);
    }

    /**
     * 新增资产盘点
     *
     * @param assetCheck 资产盘点
     * @return 结果
     */
    @Override
    public int insertAssetCheck(AssetCheck assetCheck)
    {
        assetCheck.setCreateTime(DateUtils.getNowDate());
        return assetCheckMapper.insertAssetCheck(assetCheck);
    }

    /**
     * 修改资产盘点
     *
     * @param assetCheck 资产盘点
     * @return 结果
     */
    @Override
    public int updateAssetCheck(AssetCheck assetCheck)
    {
        assetCheck.setUpdateTime(DateUtils.getNowDate());
        return assetCheckMapper.updateAssetCheck(assetCheck);
    }

    /**
     * 批量删除资产盘点
     *
     * @param ids 需要删除的资产盘点主键
     * @return 结果
     */
    @Override
    public int deleteAssetCheckByIds(Long[] ids)
    {
        return assetCheckMapper.deleteAssetCheckByIds(ids);
    }

    /**
     * 删除资产盘点信息
     *
     * @param id 资产盘点主键
     * @return 结果
     */
    @Override
    public int deleteAssetCheckById(Long id)
    {
        return assetCheckMapper.deleteAssetCheckById(id);
    }
}
